package com.danco.training.zaneuskaya.controller.claim;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.danco.training.zaneuskaya.api.ClaimService;
import com.danco.training.zaneuskaya.controller.GenericController;
import com.danco.training.zaneuskaya.service.impl.ClaimServiceImpl;

public class ClaimListController extends GenericController {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6686409188343484894L;
	
	
	private ClaimService claimService;


	public ClaimListController() {
		super();
		claimService = ClaimServiceImpl.getClaimStorageServiceInstance();
	}
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

		
		req.setAttribute("claims", claimService.getClaimsSortedByAlphabet());
		req.getRequestDispatcher("/WEB-INF/views/claim/list.jsp").forward(req, resp);

	}
	
	
	

}
